package com.lkl.controller;

import com.lkl.bean.BaseReq;
import com.lkl.bean.BaseResp;
import com.lkl.service.TravelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author lkl
 * @Description
 * @Date 2022/3/30
 */
@RestController
@RequestMapping("travel")
public class TravelController {

    @Autowired
    TravelService travelService;

    @RequestMapping("/findAll")
    public BaseResp findAll(@RequestBody BaseReq baseReq) {

        return travelService.findAll(baseReq);

    }

    @RequestMapping("/pay/{id}")
    public BaseResp pay(@PathVariable("id") Integer id){

        return travelService.pay(id);
    }

    @RequestMapping("/findById/{id}")
    public BaseResp findById(@PathVariable("id")Integer id){

        return travelService.findById(id);

    }

}
